-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【PIR Dist Op Reg No.30】 reg nop #62541
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
0674e50
to
5a1404a
Compare
@xiaoyewww 已经有分布式同学注册了这个Op,你可以添加下 单测即可,不需要更改op_compat.yaml。现在的错误应该是组网时传入的shape类型不符合要求,换成List试试。 |
是指 同理,#62494 也是这个报错,麻烦请教一下这是为什么? |
class TestNopTranslator(test_op_translator.TestOpTranslator): | ||
def append_op(self): | ||
self.op_type = "nop" | ||
x = paddle.ones(shape=(1), dtype='float32') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x = paddle.ones(shape=(1), dtype='float32') | |
x = paddle.ones(shape=(1,), dtype='float32') |
现在报错处的代码如下:
def check_shape(shape):
"""
Check shape type and shape elements type before passing it to fill_constant
"""
if isinstance(shape, Variable):
check_dtype(shape.dtype, 'shape', ['int32', 'int64'], 'fill_constant')
else:
for ele in shape:
从报错提示也可以看出这里我们传入的shape是一个int而非list。
这是因为,在python中,元组要这样写:
>>> type((1))
<class 'int'>
>>> type((1,))
<class 'tuple'>
可以改下看看。下面的out也要做同样的修改。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多谢,重新触发ci可以通过了~
@@ -14,6 +14,7 @@ list(APPEND DISTRIBUTED_OP_TRANSLATOR_TEST test_distributed_fused_lamb_init) | |||
list(APPEND DISTRIBUTED_OP_TRANSLATOR_TEST test_partial_send_translator) | |||
list(APPEND DISTRIBUTED_OP_TRANSLATOR_TEST test_c_reduce_max_translator) | |||
list(APPEND DISTRIBUTED_OP_TRANSLATOR_TEST test_c_reduce_prod_translator) | |||
list(APPEND DISTRIBUTED_OP_TRANSLATOR_TEST test_nop_translator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议按字母序排列,可以减少冲突的可能
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,这里我看上面已经不是按字母排列了,就顺序添加了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,这里麻烦你顺便调整下,现在大家的PR虽然都可以合入了,但是会因为冲突导致需要重复找人review,挺不方便的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改,麻烦review
PR types
Others
PR changes
Others
Description
#60436
注册算子nop